#ifndef TOOLS_CONFIG_H
#define TOOLS_CONFIG_H

#include "Variant.h"

namespace Tool
{

class ExportAPI Config
{
public:
    Config();
    virtual ~Config();
    virtual void Load(const std::string &path) = 0;
    virtual void Save(const std::string &path) = 0;
    virtual bool IsExist(const std::string &group);
    virtual bool IsExist(const std::string &group, const std::string &key);
    virtual void SetValue(const std::string &group, const std::string &key, const Variant value);
    virtual void SetDefaultValue(const std::string &group, const std::string &key, const Variant &defaultValue);
    virtual Variant &GetValue(const std::string &group, const std::string &key, const Variant &defaultValue = Variant());
    virtual VariantHash& GetGroupValue(const std::string &group);
    virtual VariantHash& operator [](const std::string &group);
    virtual Variant &GetConfig();

protected:
    Variant m_config;
};

}
#endif // CONFIG_H
